<template>
	<view v-if="list && list.length > 0" style="padding-bottom: 120rpx;">
	  <view v-for="(item, index) in list" :key="index">
	    <u-cell :isLink="true" :border="true" @click="navigateTo(item)">
	    	<view slot="title" class="notice-record-title"><text>单号</text>[{{  }}OUT_ORDER_20250918132231000]</view>
	    	<view slot="label" class="notice-record-desc">
	    		<u-line length="106%"></u-line>
	    		<view style="display: flex;justify-content: space-between;margin: 10rpx 0;">
	    			<view>半成品出库</view>
	    			<view>未开始</view>
	    			<view>创建时间</view>
	    		</view>
	    	</view>
	    </u-cell>
	    <u-gap height="10" bgColor="#ebebeb"></u-gap>
	  </view>
	  <u-toast ref="uToast"></u-toast>
	  <u-loadmore :status="status" />
	</view>
	<u-empty v-else>
		<u-toast ref="uToast"></u-toast>
	</u-empty>
</template>

<script>
	// import {} from '@/api/'
	export default {
		data() {
			return {
				query: {
					current: 1,
					size: 10
				},
				total: '',
				loadFinish: false,
				status: 'loadmore',
				list: ['']
			};
		},
		onShow() {
			this.query.current = 1
			this.toQuery()
		},
		methods: {
			async toQuery() {
				// const res = await XXXAPI(this.query)
				// this.list = res.data.content
				// this.total = res.data.totalElements
				// if(this.total < this.query.size) {
				//   this.loadFinish = true
				//   this.status = 'nomore'
				// }
			},
			// 滚动触底
			onReachBottom() {
			  // this.status = 'loading';
			  // if(this.loadFinish) {
			  //   this.status = 'nomore'
			  //   this.$refs.uToast.show({
			  //     type: 'warning',
			  //     message: "入库单已加载完毕"
			  //   })
			  //   return
			  // } else {
			  //   this.query.current++
			  // }
			  // XXXAPI(this.query).then(res => {
					// this.list.push(...res.data.content)
					// this.total = res.data.totalElements
					// this.status = 'loadmore'
					// if(this.query.current * this.query.size > res.totalElements) {
					// 	this.loadFinish = true
					// 	this.status = 'nomore'
					// }
			  // })
			},
			navigateTo(val) {
				this.SET_MOVE_DATA(val)
				uni.navigateTo({
					url: `/`
				})
			}
		}
	}
</script>

<style lang="scss">

::v-deep .u-cell__body {
	padding: 12rpx !important;
	align-items: start;
}
	
.notice-record-title {
	margin: 10px 0;
}
.notice-record {
  display: flex;
  padding: 0;

  &-content {
    margin-left: 8px;
  }

  &-title {
    font-size: 28rpx;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  &-title .read {
    color: #ccc;
  }

  &-desc {
    padding: 4px 0;
    font-size: 12px;
    color: #909399;
    // display: flex;
  }
}
</style>
